import 'package:fish_redux/fish_redux.dart';
import 'package:flutter/material.dart' hide Action;
import 'package:hc_center/routes/routes.dart';

import 'start_action.dart';
import 'start_state.dart';

Effect<StartState> buildEffect() {
  return combineEffects(<Object, Effect<StartState>>{
    StartAction.action: _onAction,
    Lifecycle.initState: _onInit
  });
}

void _onAction(Action action, Context<StartState> ctx) {
}
void _onInit(Action action, Context<StartState> ctx) {
  Future.delayed(Duration(seconds: 3), () {
    _pushToMainPage(ctx.context);
  });
}
Future _pushToMainPage(BuildContext context) async {
  Navigator.pushNamed(context, RoutesName.routePage);
}